package com.tesisutn.restsoft.dominio.caja;

import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.tesisutn.restsoft.dominio.empleado.Empleado;
import com.tesisutn.restsoft.dominio.interfaces.ObjetoDeDominio;

@Entity
public class CierreCaja implements ObjetoDeDominio{
	@Id
    @GeneratedValue
    private Long id;
    private Date fecha;
    @ManyToOne
    private Caja caja;
    private Double montoInicial;
    private Double montoCierre;
    @ManyToOne
    private Empleado responsable;
    @OneToMany
    @JoinColumn
    private Set<Cobro> cobros;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Caja getCaja() {
        return caja;
    }

    public void setCaja(Caja caja) {
        this.caja = caja;
    }

    public Double getMontoInicial() {
        return montoInicial;
    }

    public void setMontoInicial(Double montoInicial) {
        this.montoInicial = montoInicial;
    }

    public Double getMontoCierre() {
        return montoCierre;
    }

    public void setMontoCierre(Double montoCierre) {
        this.montoCierre = montoCierre;
    }

    public Empleado getResponsable() {
        return responsable;
    }

    public void setResponsable(Empleado responsable) {
        this.responsable = responsable;
    }

    public Set<Cobro> getCobros() {
        return cobros;
    }

    public void addCobro(Cobro cobro){
        cobros.add(cobro);
    }

    public void removeCobro(Cobro cobro){
        cobros.remove(cobro);
    }
}
